package com.changgou.search.controller;

import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;
import com.changgou.search.service.ImportService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 输入导入ES控制器
 *
 * @author gaofeng
 * @date 2025年04月23日 13:04
 */
@RestController
@RequestMapping("/search")
public class ImportController {
    @Resource
    private ImportService searchService;

    /**
     * 查询所有的sku数据导入ES
     *
     * @return com.changgou.entity.Result
     */
    @GetMapping("/import")
    public Result importDataList() {
        searchService.importDataList();
        return new Result<>(true, StatusCode.OK, "导入成功");
    }
}
